package com.tanhua.server.service;

import com.tanhua.dubbo.mongo.api.UserLocationApi;
import com.tanhua.server.interceptor.UserHolder;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class BaiduService {


    @DubboReference
    private UserLocationApi userLocationApi;


    /*
    * latitude 纬度
    * longitude  经度
    * addrStr 位置
    *
    * 上报地理信息
    * */
    public void location(Double latitude, Double longitude, String addrStr) {

      //获得用户id
        Long userId = UserHolder.getUserId();

        userLocationApi.save(userId,latitude,longitude,addrStr);

    }
}
